public class BuilderPatternDemo {
    public static void main(String[] args) {
//        MealBuilder mealBuilder = new MealBuilder(); //建造者
//
//        Meal vegMeal = mealBuilder.prepareVegMeal();
//        System.out.println("Veg Meal");
//        vegMeal.showItems();
//        System.out.println("Total Cost: " +vegMeal.getCost());
//
//        Meal nonVegMeal = mealBuilder.prepareNonVegMeal();
//        System.out.println("\n\nNon-Veg Meal");
//        nonVegMeal.showItems();
//        System.out.println("Total Cost: " +nonVegMeal.getCost());


        Meal vegMeal = new VegMealBuilder().prepareMeal();
        System.out.println("Veg Meal");
        vegMeal.showItems();
        System.out.println("Total Cost: " +vegMeal.getCost());

        Meal nonVegMeal = new NonVegMealBuilder().prepareMeal();
        System.out.println("\n\nNon-Veg Meal");
        nonVegMeal.showItems();
        System.out.println("Total Cost: " +nonVegMeal.getCost());
    }
}